#!/bin/bash
echo "check file name"
read newfile
cp -rf $newfile oldfile1
sleep 120
power1=`stat -c %a oldfile1`
power2=`stat -c %a $newfile`
if [ $power1 = $power2 ];
then
echo "power not have changed"
else
echo "power has changed"
fi
mtime1=`stat -c %X oldfile1`
mtime2=`stat -c %X $newfile`
if [ $mtime1 = $mtime2 ];
then
echo "mtime has not changed"
else
echo "mtime has change "
fi
value=`diff oldfile1 $newfile`
if [ -z $value ];
then
echo "oldfile1's content not changed"
else
echo "oldfile1's content changed,do you want to see it?"
read looknow
case $looknow in
 y|Y|yes|YES|yes|Yes|YEs|YE|Ye|yE)
diff $newfile oldfile1
;;
N|n|NO|no|No|On)
echo "do not look it now"
;;
esac
fi

